﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using HaiFengShop.Utils;
using HaiFengShop.Filter;
using HaiFengShop.Service;
using System.IO;
using System.DrawingCore.Imaging;
using HaiFengShop.Entity;

namespace HaiFengShop.Controllers
{
    [ApiController]
    [Route("api/[controller]/[action]")]
    public class GoodsController : ControllerBase
    {
        private readonly GoodsService goodsService;

        public GoodsController(GoodsService goodsService)
        {
            this.goodsService = goodsService;
        }

        /// <summary>
        /// 在售的商品总数
        /// </summary> 
        [HttpGet]
        public IActionResult Count()
        {
            return Ok(goodsService.GetGoodsCount());
        }

        ///// <summary>
        ///// 商品详情页数据
        ///// </summary> 
        //[HttpGet]
        //public IActionResult Detail(int id)
        //{
        //    return Ok(goodsService.GetOneGoods(id));
        //}


        ///// <summary>
        ///// 获得商品列表
        ///// </summary> 
        //[HttpGet]
        //public IActionResult List(string keyword, string sort, string order, string sales)
        //{
        //    return Ok(goodsService.GetGoodsList(keyword.Trim(), sort, order, sales));
        //}


        ///// <summary>
        ///// 分享商品
        ///// </summary> 
        //[HttpGet]
        //public IActionResult GoodsShare(int id)
        //{
        //    return Ok(goodsService.GetGoodsShare(id));
        //}

    }
}

